package com.example.shiwuyouproject.ui.fragment.my.activity.viewmodel

import androidx.lifecycle.MutableLiveData
import com.example.shiwuyouproject.base.BaseViewModel
import com.example.shiwuyouproject.ui.my.bean.PersonalInformationBean

class AcademicCertificationViewModel:BaseViewModel() {

    private val loginRepository by lazy { RetrofitClient.getApiService() }
    val getGenRenStatus = MutableLiveData<PersonalInformationBean>()
    fun getRealNameAuthenticationData(){
        launch(
            block = {
                val codeStatus = loginRepository.userUpdate()
                getGenRenStatus.value=codeStatus.result()
            },
            error = {
            },
            cancel = {

            },
            showErrorToast = false
        )
    }

    val getPostStatus = MutableLiveData<Boolean>()
    /**
     * 保存数据
     *
     */
    fun jiaoxuetedian(eduend_time:String, eduimg
    :String,eduno:String){
        val hashMap:MutableMap<String, String> = HashMap()
        hashMap["eduend_time"] = eduend_time
        hashMap["eduimg"] = eduimg
        hashMap["eduno"] = eduno
        launch(
            block = {
                val codeStatus = loginRepository.addUserUpdate(hashMap)
                getPostStatus.value=codeStatus.success()
            },
            error = {
                getPostStatus.value=false
            },
            cancel = {
                getPostStatus.value=false
            },
            showErrorToast = false
        )
    }
}